package com.syaccp.mapper;

import com.syaccp.model.TWithdrawalDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.transaction.annotation.Transactional;

import java.sql.SQLException;
import java.util.List;

/**
 * @Entity com.syaccp.model.TWithdrawalDetails
 */
@Mapper
public interface TWithdrawalDetailsMapper extends BaseMapper<TWithdrawalDetails> {
    //查询全部体现详情  加上 用户表中的用户余额，以及用户消费总金额
    List<TWithdrawalDetails> listAll(TWithdrawalDetails tWithdrawalDetails) throws SQLException;

    //转账  操作两个表  资金流水表:修改status状态  员工表  修改员工剩余余额,和消费总金额   公司表:修改公司余额

    int updateStatus(TWithdrawalDetails tWithdrawalDetails) throws SQLException;

    int updateCustomer(TWithdrawalDetails tWithdrawalDetails) throws SQLException;

    int updateDept(TWithdrawalDetails tWithdrawalDetails) throws SQLException;


    /*
     * 1.获到前台的 银行卡号加提现金额
     * 2.查询出 申请人ID
     * 3.就可以获取公司名称
     * 4.根据公司名称修改公司余额，根据申请人id修改申请人的余额以及消费总额
     * */
    TWithdrawalDetails WithdrawalOfCompanyBalance(TWithdrawalDetails tWithdrawalDetails) throws SQLException;

    int updateCustomer1(TWithdrawalDetails tWithdrawalDetails) throws SQLException;
    int updateDept1(TWithdrawalDetails tWithdrawalDetails) throws SQLException;


    TWithdrawalDetails information();

    List<TWithdrawalDetails> queryCondition(Integer status);

    int alterTheState(TWithdrawalDetails details);

    //新增备注的方法
    int insertRemark(TWithdrawalDetails withdrawalDetails) throws SQLException;

    //修改状态的方法
    int updateState (TWithdrawalDetails withdrawalDetails) throws SQLException;

}




